package cn.iocoder.yudao.module.lowcode.controller.admin.datasource.vo;


import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Schema(description = "管理后台 - 数据源配置 Response VO")
@Data
@ExcelIgnoreUnannotated
public class DatasourceConfigRespVO {

    @Schema(description = "数据源编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty("数据源编号")
    private Long id;

    @Schema(description = "数据源名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "主数据库")
    @ExcelProperty("数据源名称")
    private String name;

    @Schema(description = "数据库类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "mysql")
    @ExcelProperty("数据库类型")
    private String type;

    @Schema(description = "JDBC连接URL", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("JDBC连接URL")
    private String url;

    @Schema(description = "用户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "root")
    @ExcelProperty("用户名")
    private String username;

    @Schema(description = "JDBC驱动类名", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("JDBC驱动类名")
    private String driverClassName;

    @Schema(description = "初始化连接数", example = "1")
    @ExcelProperty("初始化连接数")
    private Integer initialSize;

    @Schema(description = "最小空闲连接数", example = "1")
    @ExcelProperty("最小空闲连接数")
    private Integer minIdle;

    @Schema(description = "最大活动连接数", example = "8")
    @ExcelProperty("最大活动连接数")
    private Integer maxActive;

    @Schema(description = "用于检测连接是否有效的SQL", example = "SELECT 1")
    @ExcelProperty("用于检测连接是否有效的SQL")
    private String testQuery;

    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty("状态")
    private Integer status;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;
}